package com.gitee.kamismile.stone.rpc.common.invocation;


import com.gitee.kamismile.stone.rpc.common.provider.producer.StoneProviderMeta;
import com.gitee.kamismile.stone.rpc.common.support.StoneURL;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

public class StoneInvocationContext<T> {

    private String serverName;

    private String serverVersion;

    private Class<T> type;

    private StoneURL stoneURL;

    private StoneProviderMeta stoneProviderMeta;

    public StoneProviderMeta getStoneProviderMeta() {
        if (Objects.isNull(stoneProviderMeta)) {
            stoneProviderMeta = new StoneProviderMeta(this.getServerName(),  this.getServerVersion());
        }
        return stoneProviderMeta;
    }


    public Class<T> getType() {
        return type;
    }

    public void setType(Class<T> type) {
        this.type = type;
    }

    public StoneURL getStoneURL() {
        return stoneURL;
    }

    public void setStoneURL(StoneURL stoneURL) {
        this.stoneURL = stoneURL;
    }


    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public String getServerVersion() {
        return serverVersion;
    }

    public void setServerVersion(String serverVersion) {
        this.serverVersion = serverVersion;
    }
}
